<!--{if !$_G['inajax']}-->
<!--{eval $_G['home_tpl_titles'] = array($album['albumname'], '{lang album}');}-->
<!--{eval $friendsname = array(1 => '{lang friendname_1}',2 => '{lang friendname_2}',3 => '{lang friendname_3}',4 => '{lang friendname_4}');}-->
<!--{eval $pageview = '<a href="home.php?mod=space&username=' .$space[username] . '&do=album">' . lang("home/template","album") . '</a> &raquo; ' . $album[albumname];}-->
<!--{template home/space_header}-->
<!--{template home/space_site_left}-->
<div style="padding-left:10px;">
<!--{subtemplate home/space_short_profile}-->
</div>

<div class="bm z" style="width:770px;">
    <div class="bm">
        <div class="bm_c">
<!--{else}-->
<!--{template common/header_ajax}-->
<!--{/if}-->    
        <!--{if $list}-->
            <!--{if !$_G['inajax']}-->
            <ul class="ml mlp cl dat-width"  id="feed_div">
            <!--{/if}-->   
            <!--{loop $list $key $value}-->
                <li>
                <a href="home.php?mod=space&uid=$value[uid]&do=$do&picid=$value[picid]" onclick="show_pic(this.href, '$value[picid]'); return false; "><!--{if $value[pic]}--><img src="{if strrpos($value[pic], "data/attachment/album/")}{$value[pic]}.thumb.jpg{else}{$value[pic_thumb]}{/if}" alt="{$value[title]}" /><!--{/if}--></a><!--{if $value[status] == 1}--><b>({lang moderate_need})</b><!--{/if}-->
                </li>
            <!--{/loop}-->
        <!--{if !$_G['inajax']}-->
        	</ul>
        <!--{if $pricount}--><p>{lang hide_pic}</p><!--{/if}-->
        	<!--{if $multi}-->
            <div id="load_more"></div>
        	<div id="loading_more_feed" style="display:none"></div>
            <!--{/if}-->
        <!--{/if}-->
        <!--{else}-->
            <!--{if !$_G['inajax']}-->
            <!--{if !$pricount}--><p class="emp">{lang no_pics}</p><!--{/if}-->
            <!--{if $pricount}--><p>{lang hide_pic}</p><!--{/if}-->
            <!--{/if}-->
        <!--{/if}-->
 <!--{if !$_G['inajax']}-->   
        <!--[diy=diycontentbottom]--><div id="diycontentbottom" class="area"></div><!--[/diy]-->
        </div>
    </div>  
    <div class="tbmu cl">
        <!--{if $album[albumid]>0}-->
        <a href="home.php?mod=spacecp&ac=favorite&type=album&id=$album[albumid]&spaceuid=$space[uid]&handlekey=sharealbumhk_{$album[albumid]}" id="a_favorite" onclick="showWindow(this.id, this.href, 'get', 0);" class="oshr ofav">{lang favorite}</a>
        <a href="home.php?mod=spacecp&ac=share&type=album&id=$album[albumid]&handlekey=sharealbumhk_{$album[albumid]}" id="a_share" onclick="showWindow(this.id, this.href, 'get', 0);" class="oshr">{lang share}</a>
        <!--{/if}-->
        <div class="y">
            <!--{hook/space_album_op_extra}-->
            <!--{if $space[self] && !$album[readonly]}--><a href="{if $album[albumid] > 0}home.php?mod=spacecp&ac=album&op=edit&albumid=$album[albumid]{else}home.php?mod=spacecp&ac=album&op=editpic&albumid=0{/if}">{lang edit}</a><span class="pipe">|</span><!--{/if}-->
            <!--{if ($_G[uid] == $album[uid] || checkperm('managealbum')) && $album[albumid] > 0 && !$album[readonly]}-->
                <a href="home.php?mod=spacecp&ac=album&op=delete&albumid=$album[albumid]&uid=$album[uid]&handlekey=delalbumhk_{$album[albumid]}" id="album_delete_$album[albumid]" onclick="showWindow(this.id, this.href, 'get', 0);">{lang delete}</a><span class="pipe">|</span>
            <!--{/if}-->
            <!--{if $_G[uid] != $album[uid]}-->
            <a href="javascript:;" onclick="showWindow('miscreport$album[albumid]', 'misc.php?mod=report&rtype=album&uid=$album[uid]&rid=$album[albumid]', 'get', -1);return false;">{lang report}</a><span class="pipe">|</span>
            <!--{/if}-->
        </div>
            <!--{if $album['catname']}-->
            <span class="xg1">{lang system_cat}</span><a href="home.php?mod=space&do=album&catid=$album[catid]&view=all">$album[catname]</a><span class="pipe">|</span>
            <!--{/if}-->
            <!--{if $album[picnum]}-->{lang total} $album[picnum] {lang album_pics}<!--{/if}-->
            <!--{if $space[self] && !$album[readonly]}--><span class="pipe">|</span><span class="xi2"><a name="picblock" href="home.php?mod=spacecp&ac=upload" class="addnew">{lang upload_pic}</a></span><!--{/if}-->
            <!--{if $album['friend']}-->
            <span class="xg1"> &nbsp; {$friendsname[$value[friend]]}</span>
            <!--{/if}-->
        <!--{if $album[depict]}--><p class="album_message">$album[depict]</p><!--{/if}-->
        <br /><span class="xg1"> &nbsp;{lang postime}: <!--{date($album[dateline])}--><span class="pipe">|</span>{lang updatetime}: <!--{date($album[updatetime])}--></span>
    </div>
    <div id="comment" class="cl"></div>
    <!-- Begin list comment -->
    <!--{if $id > 0}-->
    <div class="cmt hcmd">
    	 <!--{if $cid}-->
        <div class="i">
            {lang current_comment}
        </div>
        <!--{/if}-->
    	<i class="x-nhot"></i>
    	<div class="xld xlda">
            <h3 class="ptn pbn bbs ">
                <!--{if $_G['uid']}-->
                <a href="home.php?mod=space&uid=$album[uid]&do=$do&id=$id#quickcommentform_{$id}" onclick="if($('comment_message')){$('comment_message').focus();return false;}" class="y xi2 xw0">{lang publish_comment}</a>
                <!--{/if}-->
                {lang comment} (<span id="comment_replynum">$countcomment</span> {lang blog_replay})
            </h3>
        </div>
        <div id="div_main_content" class="mbm">
            <div id="comment_ul" class="xld xlda">
            <!--{eval $lastcid = 0;}-->
            <!--{loop $list_comment $k $value}-->
                <!--{template home/space_comment_li}-->
                <!--{eval $lastcid = $value['cid'];}-->
            <!--{/loop}-->
            </div>
        </div>
        <!--{if $_G['uid']}-->
        <div id="form_comment_album{$id}" style="padding-right:10px; background-color:#F0F2F7">
            <table cellpadding="0" width="100%">
                <tr>
                    <td valign="top" width="50px">
                        <div class="avt">
                            <a href="home.php?mod=space&uid=$_G['uid']" class="avt_l" c="1">
                                <!--{avatar($_G['uid'],small)}-->
                            </a>
                        </div>
                    </td>
                    <td width="*">
                        <form id="quickcommentformalbum_{$id}" action="home.php?mod=spacecp&ac=comment" method="post" autocomplete="off" onsubmit="ajaxpost('quickcommentformalbum_{$id}', 'return_qcalbum_$id');doane(event);">
                            <p>
                                <span id="comment_face" title="{lang insert_emoticons}"  onclick="showFace(this.id, 'comment_message');return false;" class="cur1"><img src="{IMGDIR}/facelist.gif" alt="facelist" class="vm" /></span>
                                <!--{hook/space_album_face_extra}-->
                                <!--{if $_G['setting']['magicstatus'] && !empty($_G['setting']['magics']['doodle'])}-->
                                <a id="a_magic_doodle" href="home.php?mod=magic&mid=doodle&showid=comment_doodle&target=comment_message" onclick="showWindow(this.id, this.href, 'get', 0)"><img src="{STATICURL}image/magic/doodle.small.gif" alt="doodle" class="vm" title="$_G['setting']['magics']['doodle']" /></a>
                                <!--{/if}-->
                            </p>
                            <textarea id="comment_message" onkeydown="ctrlEnter(event, 'commentsubmitalbum_btn');  resizeTx(this);" onfocus="txtTxCommentChk(this.id, 1); resizeTx(this);" onblur="onckeydown=true; resizeTx(this); txtTxCommentChk(this.id, 2)" name="message" rows="1"  class="pts"  style="color:#CCC;">Viết bình luận...</textarea>
                        <!--{if checkperm('seccode') && ($secqaacheck || $seccodecheck)}-->
                            <!--{block sectpl}--><sec> <span id="sec<hash>" onclick="showMenu(this.id);"><sec></span><div id="sec<hash>_menu" class="p_pop p_opt" style="display:none"><sec></div><!--{/block}-->
                            <div class="mtm mbm sec"><!--{subtemplate common/seccheck}--></div>
                        <!--{/if}-->
                            <p class="pns" style="margin-left:55px;">
                                <input type="hidden" name="referer" value="home.php?mod=space&uid=$album[uid]&do=$do&id=$id" />
                                <input type="hidden" name="id" value="$id" />
                                <input type="hidden" name="idtype" value="albumid" />
                                <input type="hidden" name="handlekey" value="qcalbum_{$id}" />
                                <input type="hidden" name="commentsubmit" value="true" />
                                <input type="hidden" name="quickcomment" value="true" />
                                <button type="submit" name="commentsubmitalbum_btn" value="true"  style="display:none;" id="commentsubmitalbum_btn" class="pn"{if !$_G[uid]} onclick="showWindow(this.id, this.form.action);return false;"{/if}><strong>{lang comment}</strong></button>
                                <span id="return_qcalbum_{$id}"></span>
                        	</p>
                       		<input type="hidden" name="formhash" value="{FORMHASH}" />
                        </form>
                    </td>
                </tr>
            </table>
        </div>
        <!--{/if}-->
    </div>
    <!--{if $multi_comment}--><div class="pgs cl mbm">$multi_comment</div><!--{/if}-->
    <div style="clear:both"></div><!--End list_comment -->
    <!--{/if}-->
    <!--{if $albumlist}-->
    <div class="bm mtm">
        <div class="bm_h cl">
            <!--{if $albumlist}-->
            <div class="y mtn">
                    <a href="javascript:;" id="sabup" onclick="switchAlbum(0);this.blur();return false;" title="{lang previous_album}"><img src="{STATICURL}image/common/pic_nv_prev.gif" alt="{lang previous_album}"/></a> 
                    <a href="javascript:;" id="sabdown" onclick="switchAlbum(1);this.blur();return false;" title="{lang next_album}"><img src="{STATICURL}image/common/pic_nv_next.gif" alt="{lang next_album}"/></a>
            </div>
            <!--{/if}-->
            <h2>{lang switch_pics}</h2>
        </div>
        <div class="bm_c not-pad">
            <div id="pnv" class="pns cl">
                <!--{if $albumlist}-->	
                <!--{loop $albumlist $key $albums}-->
                <ul id="albumbox_$key" class="ptm ml z" {if !isset($albums[$id]) && !($key==0 && $id<0)} style="display: none;"{else}{eval $nowalbum=$key;}{/if}>
                    <!--{loop $albums $akey $value}-->
                    <!--{eval $pwdkey = 'view_pwd_album_'.$value['albumid'];}-->
                    <li style="width: 140px;">
                        <div class="c">
                            <a href="home.php?mod=space&uid=$value[uid]&do=album&id=$value[albumid]" title="$value[albumname]" {if $value[uid]!=$_G[uid] && $value[friend]=='4' && $value[password] && empty($_G[cookie][$pwdkey])} onclick="showWindow('right_album_$value[albumid]', this.href, 'get', 0);"{/if}><!--{if $value[pic]}--><img src="$value[pic]" alt="$value[albumname]" width="120" height="120" /><!--{/if}--></a>
                            <p><a href="home.php?mod=space&uid=$value[uid]&do=album&id=$value[albumid]" title="$value[albumname]" {if $value[uid]!=$_G[uid] && $value[friend]=='4' && $value[password] && empty($_G[cookie][$pwdkey])} onclick="showWindow('right_album_$value[albumid]', this.href, 'get', 0);"{/if}>$value[albumname]</a></p>
                        </div>
                    </li>
                    <!--{/loop}-->
                </ul>
                <!--{/loop}-->
                <!--{/if}-->
            </div>
        </div>
    </div>
        <!--{/if}-->
</div>
<div class="y column" style="width:225px;">
    <!--{subtemplate common/ads_right}-->
</div>
<!--{template home/space_site_right}-->
<script type="text/javascript" language="javascript">
<!--{if $multi}-->
	var loadfeed = true;
	var url = 'home.php?mod=space&uid=$space[uid]&do=album&id=$_G[gp_id]';
<!--{/if}-->
 <!--{if $_G[gp_id] > 0}-->
	var albumid_lastcid	= $lastcid;
	var album_id		= $id;
	var album_viewautoload_$id = null;
	function _album_viewautoload_$id(){
		return setInterval(function(){comment_autoload('comment_ul', 'album');}, 10000);
	}
	
	jQuery(document).ready(function(){
		album_viewautoload_$id = _album_viewautoload_$id();
	});
	function succeedhandle_qcalbum_$id(url, msg, values) {
		if(values['cid']) {
			if($('comment_message')) {
				$('comment_message').value= '';
			}
			album_viewautoload_$id = window.clearInterval(album_viewautoload_$id);
			comment_autoload('comment_ul', 'album');
			album_viewautoload_$id = _album_viewautoload_$id();
			setTimeout(function(){
				$('return_qcalbum_{$id}').innerHTML = '';
			}, 3000);
		} else {
			$('return_qcalbum_{$id}').innerHTML = msg;
		}
		<!--{if checkperm('seccode') && $sechash}-->
			<!--{if $secqaacheck}-->
			updatesecqaa('$sechash');
			<!--{/if}-->
			<!--{if $seccodecheck}-->
			updateseccode('$sechash');
			<!--{/if}-->
		<!--{/if}-->
	}
	<!--{/if}-->
	function addFriendCall(){
		var el = $('friendinput');
		if(!el || el.value == "")	return;
		var s = '<input type="checkbox" name="fusername[]" class="pc" value="'+el.value+'" id="'+el.value+'" checked="checked">';
		s += '<label for="'+el.value+'">'+el.value+'</label>';
		s += '<br />';
		$('friendscall').innerHTML += s;
		el.value = '';
	}
	resizeImg('div_main_content','450');
	
	var elems = selector('dd[class~=magicflicker]');
	for(var i=0; i<elems.length; i++){
		magicColor(elems[i]);
	}

	var nowAlbum = $nowalbum;
	var maxAlbum = $maxalbum;
	function switchAlbum(down) {
		if(down) {
			if(nowAlbum + 1 < maxAlbum) {
				$('albumbox_'+nowAlbum).style.display = 'none';
				nowAlbum++;
				$('albumbox_'+nowAlbum).style.display = '';
			}
		} else {
			if(nowAlbum - 1 >= 0) {
				$('albumbox_'+nowAlbum).style.display = 'none';
				nowAlbum--;
				$('albumbox_'+nowAlbum).style.display = '';
			}
		}
		initSwitchButton();
	}
	function initSwitchButton(){
		$('sabdown').style.display = maxAlbum-nowAlbum == 1 ? 'none' : '';
		$('sabup').style.display = nowAlbum ? '' : 'none';
	}
	window.onload = function () {initSwitchButton();}
</script>       
<!--{template common/footer}-->
<!--{else}-->
<!--{template common/footer_ajax}-->
<!--{/if}--> 